import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import lifecircle from '@/components/lifecircle/lifecircle'
import bind from '@/components/bind'
import computed from '@/components/computed'


Vue.use(Router)


export default new Router({
  routes: [
   //这个是基础学习的路由
    {
      path: '/',
      name: 'HelloWorld',
      component: resolve=>require(['@/components/HelloWorld'],resolve)
    },
    
    {
      path:'/life',
      name:'life',
      component:resolve=>require(['@/components/lifecircle/lifecircle'],resolve)
    },
    {
      path:'/vuex',
      name:'vuex',
      component:resolve=>require(['@/components/vuexstore'],resolve)
    },
    // {
    //   path:'/bind',
    //   name:'bind',
    //   component:resolve=>require(['@/components/bind'],resolve)
    // },
    // {
    //   path:'/computed',
    //   name:'computed',
    //   component:resolve=>require(['@/components/computed'],resolve)
    // },
    // {
    //   path:'/transmittingFather',
    //   name:'transmittingFather',
    //   component:resolve=>require(['@/components/transmittingFather'],resolve)
    // },
    // {
    //   path:'/extend',
    //   name:'extend',
    //   component:resolve=>require(['@/components/extend'],resolve)
    // },
    // {
    //   path:'/v-moudel',
    //   name:'v-moudel',
    //   component:resolve=>require(['@/components/v-moudel'],resolve)
    // },
    // {
    //   path:'/slot',
    //   name:'slot',
    //   component:resolve=>require(['@/components/slot'],resolve)
    // },
    // {
    //   path: '/',
    //   name: 'HelloWorld',
    //   // 路由元信息
    //   meta:{
    //     //这个不会显示在路由之中
    //     title:'this is app',
    //     description:'asdad'
    //   },
    //   children:[
        
    //   ],
    //   component: resolve=>require(['@/components/HelloWorld'],resolve)
    // },
    // {
    //   path:'/app',
    //   components:{
    //     default:HelloWorld,
    //     a:bind
    //   }
    // }

    
    {
      path: '**',
      component: resolve=>require(['@/components/HelloWorld'],resolve),
      redirect:'/'
    },
  ]
})
